package com.tarena.all;

public class NarcissisticNumber {
	public static void main(String[] args) {
		for(int i = 1; i <= 10000; i++){
			int sum = 0;
			for(int j = i; j > 0; j /= 10){
				int k = j % 10;
				sum += k * k * k;
			}
			if(sum == i){
				System.out.println(i);
			}
		}
	}
}
